home *** CD-ROM | disk | FTP | other *** search
- on clickChallenge
- global gPage, gChallengeIndex, gChallengeOrder, gCurQuad, gBlindfold, gPathList, gScreenMode
- highlightChalSpeaker()
- if gBlindfold then
- hideAllResponses()
- drawChallenge()
- end if
- set index to value(char gChallengeIndex of gChallengeOrder)
- if getaProp(gScreenMode, #PCTCHAL) <> #NONE then
- set base to getQuadBase(gCurQuad)
- setChallengePict(base + index - 1)
- end if
- if getaProp(gScreenMode, #SNDCHAL) <> #NONE then
- set index to index + ((gPage - 1) * 4)
- set fname to makeImagePath(gPathList, #sound, index)
- sound playFile 1, fname
- end if
- if getaProp(gScreenMode, #TXTCHAL) = #ONPCT then
- setChallengeText()
- end if
- updateStage()
- if getaProp(gScreenMode, #SNDCHAL) = #NONE then
- if gBlindfold then
- set theWait to the ticks + 120
- if getaProp(gScreenMode, #TXTCHAL) <> #NONE then
- set w to the ticks + (length(the text of cast (344 + index)) * 5.40000000000000036)
- if w > theWait then
- set theWait to w
- end if
- end if
- updateStage()
- repeat while the ticks < theWait
- end repeat
- end if
- end if
- if the stillDown then
- repeat while the stillDown
- end repeat
- end if
- repeat while soundBusy(1) and not (the mouseDown)
- end repeat
- unhighlightChalSpeaker()
- if gBlindfold then
- hideChallenge()
- drawAllResponses()
- end if
- end
-
- on giveChallenge
- global gPage, gChallengeIndex, gChallengeOrder, gBlindfold, gPathList, gScreenMode, gHasPressed
- stopMouseTrap()
- set gHasPressed to 0
- if inChallenge() then
- if (getaProp(gScreenMode, #SNDCHAL) <> #NONE) or (gBlindfold = 1) then
- highlightChalSpeaker()
- updateStage()
- end if
- if gHasPressed = 0 then
- set index to value(char gChallengeIndex of gChallengeOrder) + ((gPage - 1) * 4)
- if getaProp(gScreenMode, #TXTCHAL) = #ONPCT then
- setChallengeText()
- end if
- if getaProp(gScreenMode, #SNDCHAL) = #NONE then
- if gBlindfold then
- set theWait to the ticks + 120
- if getaProp(gScreenMode, #TXTCHAL) <> #NONE then
- set w to the ticks + (length(the text of cast (344 + index)) * 5.40000000000000036)
- if w > theWait then
- set theWait to w
- end if
- end if
- updateStage()
- if gHasPressed = 0 then
- repeat while (the ticks < theWait) and not (the mouseDown) and not gHasPressed
- end repeat
- end if
- end if
- else
- set fname to makeImagePath(gPathList, #sound, index)
- sound playFile 1, fname
- updateStage()
- repeat while soundBusy(1) and not (the mouseDown) and not gHasPressed
- end repeat
- end if
- end if
- if (getaProp(gScreenMode, #SNDCHAL) <> #NONE) or (gBlindfold = 1) then
- unhighlightChalSpeaker()
- end if
- updateStage()
- end if
- end
-
- on drawChallenge
- global gChallengeIndex, gChallengeOrder, gScreenMode, gCurQuad, gBlindfold
- set base to getQuadBase(gCurQuad)
- set index to value(char gChallengeIndex of gChallengeOrder)
- if getaProp(gScreenMode, #TXTCHAL) = #ONPCT then
- setChalPict(base + index - 1)
- else
- if getaProp(gScreenMode, #TXTCHAL) = #top then
- if gBlindfold or (getaProp(gScreenMode, #SNDCHAL) = #UPLEFT) then
- showCTextPuppet(45)
- else
- showCTextPuppet(5)
- end if
- end if
- end if
- if getaProp(gScreenMode, #PCTCHAL) = #YES then
- setChallengePict(base + index - 1)
- end if
- updateStage()
- end
-
- on hideChallenge
- global gScreenMode
- if getaProp(gScreenMode, #TXTCHAL) = #ONPCT then
- setChalPict(341)
- hide9()
- else
- if getaProp(gScreenMode, #TXTCHAL) = #top then
- hide7()
- end if
- end if
- if getaProp(gScreenMode, #PCTCHAL) = #YES then
- setChallengePict(341)
- end if
- updateStage()
- end
-